package com.neusoft.controller;

import com.neusoft.po.CommonResult;
import com.neusoft.po.BankCard;
import com.neusoft.service.BankCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/BankCard")
public class BankCardController {
	

	@Autowired
	private BankCardService bankCardService;
	
	@GetMapping("/WalletId")
	public CommonResult<BankCard> listBankCardByWalletId(BankCard bankCard) throws Exception{
	
		 return new CommonResult(200, "success", bankCardService.listBankCardByWalletId(bankCard.getWalletId()));
	}
	
	@PostMapping("/CardId")
	public CommonResult<Integer>saveBankCard(BankCard bankCard) throws Exception{
		int result =bankCardService.saveBankCard(bankCard);
		return new CommonResult(result, "success", 200);
	}
	
	
}
